<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="like/business_link::link"></head>
<link rel="stylesheet" href="../../static/bootstrap-3.3.7-dist/css/bootstrap.css">
<link rel="shortcut icon" type="image/x-icon" th:href= "@{/static/img/timg.jpg}">
<link rel="stylesheet" href="../../static/css/merchandise.css">
<body>
<div th:include="/like/business_commen::identical">
</div>
<div class="home_page">
    <form action="/administrator/selectGoodsLikeDate" method="get">
        <div class="me_search">
            <input name="date" type="text" class="me_input" placeholder="请输入查找信息" th:value="${selectGoods}">
        </div>
        <div class="btn_search">
            <input type="submit" value="搜索">
        </div>
    </form>
    <div class="content">
        <div class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" id="add">
            添加信息
        </div>
        <!-- 模态框（Modal） -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"
                                aria-hidden="true">×
                        </button>
                    </div>
                    <div class="modal-body">
                        <!--            添加用户信息表格-->
                        <div class="number">
                            <p>ID:</p>
                            <input type="text" class="ger" id="idcard">
                            <span></span>
                        </div>
                        <div class="number">
                            <p>商品名称</p>
                            <input type="text" class="ger" id="user_number">
                            <span></span>

                        </div>
                        <div class="number">
                            <p>商品价格</p>
                            <input type="text" class="ger" id="user_limit">
                            <span></span>

                        </div>
                        <div class="number">
                            <p>交易次数</p>
                            <input type="text" class="ger" id="user_email">
                            <span></span>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default"
                                data-dismiss="modal">关闭
                        </button>
                        <button type="button" class="btn btn-primary">
                            提交更改
                        </button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->

        <!--编辑模态框-->
        <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                            &times;
                        </button>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商品名称</label>
                                <div class="col-sm-9">
                                    <input class="form-control input-old" id="goodsName">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商品价格</label>
                                <div class="col-sm-9">
                                    <input class="form-control sub-password" id="goodsPrice">
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-sm" data-dismiss="modal">关闭
                        </button>
                        <button type="button" class="btn btn-sm my-sub2">
                            提交更改
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <!--以上为编辑模态框-->

        <!--    主页面-->
        <div id="container_user">
            <!--            用户表格-->
            <div class="container" style="margin-top: 100px;">
                <table class="table table-hover table-bordered" id="employeeTable">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>商品名称</th>
                        <th>商品价格</th>
                        <th>所属店铺ID</th>
                        <th>交易次数</th>
                        <th style="text-align: center;">操作</th>
                    </tr>
                    </thead>
                    <tbody th:if="${goodsDate.size()==0}">
                        <div>该店铺没有商品！！</div>
                    </tbody>
                    <tbody th:if="${goodsDate.size()!=0}">

                    <tr th:each="oneGoods:${goodsDate}">
                        <td th:text="${oneGoods.getId()}"></td>
                        <td th:text="${oneGoods.getGoodsName()}"></td>
                        <td th:text="${oneGoods.getGoodsPrice()}"></td>
                        <td th:text="${oneGoods.getStoreId()}"></td>
                        <td th:text="${oneGoods.getBuyNumber()}"></td>
                        <td class="bus-td">
                            <ul>
                                <li th:if="!${storeShow.contains('|'+oneGoods.getId()+'|')}" class="shop-recommend"
                                    th:data-shopid="${storeId}"
                                    th:data-goodid="${oneGoods.getId()}"
                                    th:data-goodsname="${oneGoods.getGoodsName()}"
                                    th:data-goodsphoto="${oneGoods.getPhotoUrl()}"
                                >推荐</li>

                                <li th:if="${storeShow.contains('|'+oneGoods.getId()+'|')}" style="background: #4CAF50;">已推荐</li>
                                <li th:data-id="${oneGoods.getId()}" class="bus-goods" data-toggle="modal" data-target="#myModal2">编辑</li>
                                <li th:data-id="${oneGoods.getId()}" class="shop-delete">删除</li>
                            </ul>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</body>
<script th:src="@{/static/js/jquery-3.3.1.min.js}"></script>
<script th:src="@{/static/js/bootstrap.min.js}"></script>
<script th:src="@{/static/js/business_index.js}"></script>
</html>